import request from '@/utils/request'

const api_name = '/student'

export default {
    login(student) {
        return request({
            url: `${api_name}/login`,
            method: 'post',
            data: student
        })
    },
    getById(id) {
        return request({
            url: `${api_name}/getById?id=${id}`,
            method: 'get'
        })
    },
    //学生信息列表
    selectPage(current, limit, student) {
        return request({
            url: `${api_name}/selectPage?current=${current}&limit=${limit}`,
            method: 'post',
            data: student  //使用json
        })
    },
    statistic() {
        return request({
            url: `${api_name}/statistic`,
            method: 'get'
        })
    },
    //添加学生
    insert(student) {
        return request({
            url: `${api_name}/insert`,
            method: 'post',
            data: student
        })
    },
    //修改学生设置
    updateById(student) {
        return request({
            url: `${api_name}/updateById`,
            method: 'post',
            data: student
        })
    },
    //批量删除
    removeByIds(idList) {
        return request({
            url: `${api_name}/removeByIds`,
            method: 'delete',
            data: idList
        })
    },
    getStatistic() {
        return request({
            url: `${api_name}/getStatistic`,
            method: 'get'
        })
    }
}
